package com.twu.biblioteca;

import java.util.Scanner;

public class MemberLogIn {

    public int checkLogIn(CustomerDetails[] customerDetails)
    {
        int i;
        int customerNumber=1;
        String username,customerPwd;
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter your Username: ");
        username = scanner.next();
        System.out.print("Enter your password: ");
        customerPwd = scanner.next();
        for (i=1;i<5;++i)
        {
            customerNumber = customerDetails[i].LogIn(username,customerPwd);
            if (customerNumber != 0)
                break;

        }
        if (customerNumber == 0){
            System.out.println("Incorrect Password!");
            System.exit(0);
        }
        else
        {
            return customerNumber;
        }
        return 0;
    }
}
